<template>
  <div class="dashboard-container">
    <component :is="currentRole" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import merchant from './merchant/merchant'

export default {
  name: 'Dashboard',
  components: {merchant },
  data() {
    return {
      currentRole: ''
    }
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  created() {
    this.roles.forEach(res => {
      console.log(JSON.stringify(this.roles))
      if (res === 'merchant') {
        this.currentRole = 'merchant'
      }
    })
  }
}
</script>
